//
//  EditOrDeleteView.swift
//  DSHCMerchant
//
//  Created by 罗德良 on 2018/4/27.
//  Copyright © 2018年 袋鼠好车. All rights reserved.
//

import UIKit

class EditOrDeleteView: UIView {
//0 编辑  1 删除
    typealias EditOrDeleteBlock = (_ intValue:Int) -> Void
    
    var tapEditOrDelete:EditOrDeleteBlock?
    
    func callBackBlock(_ block: @escaping EditOrDeleteBlock) {
        
        tapEditOrDelete = block
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        self.frame = CGRect(x:0, y:0, width:kScreenWidth,height:ScaleHeight(100));
        self.center = CGPoint(x: kScreenWidth/2, y: kScreenHeight/2)
    }
    
    class func getEditOrDeletePopView() -> EditOrDeleteView {
        return UIView.creatFromNIB(By: "EditOrDeleteView") as! EditOrDeleteView
    }
    
    
    
    @IBAction func editBtnPress(_ sender: UIButton) {
        if tapEditOrDelete != nil {
            tapEditOrDelete!(0)
        }
    }
    

    
    @IBAction func deleteBtnPress(_ sender: UIButton) {
        if tapEditOrDelete != nil {
            tapEditOrDelete!(1)
        }
    }

}

